<?php
$dir = dirname(__FILE__)."/templates/cache/";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
			if ($file!='.' && $file!='..')  {
				echo "<br/>filename: $file : filetype: " . filetype($dir . $file) . "\n";
				unlink($dir . $file);
        	}
        }
        closedir($dh);
    }
}